﻿using iTool.ValidationExtend;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Core.DataAccess.Model.iTool.Gateway
{

    /// <summary>
    /// 启动的Service实例
    /// </summary>

    public partial class ServiceInstance
    {
        /// <summary>
        /// 关键字
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ServiceInstanceId { get; set; }
        public int NodeId { get; set; }
        public string NodeIP { get; set; }

        [Required]
        [Range(1000, 65535)]
        public int Port { get; set; }

        [Required]
        public string Title { get; set; }

        public string User { get; set; }

        [Password]
        public string Password { get; set; }

        /// <summary>
        /// iToolBase,Function,Logger,Message
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 1 正在创建，2 已完成，3 重启，4 停止, 5 不可用等待确认
        /// 11 等待停止信号， 12 等待启动信号
        /// </summary>
        public int Status { get; set; }
        public bool IsRunInDocker { get; set; }
        public string Cpu { get; set; }
        public string Memory { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string Process { get; set; }
        public DateTime? LastCheckTime { get; set; }
        public DateTime CreateTime { get; set; } = DateTime.Now;
    }
}
